/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.stefanini.pe.bbva.bp.in.to;

import java.io.Serializable;

public class File implements Serializable{
	private static final long serialVersionUID = -5416269102546174647L;
	private File fileAnt;
    private String Name;
    private String mime;

    public String getExtension() {
        return extension;
    }

    public void setExtension(String extension) {
        this.extension = extension;
    }

    public File getFileAnt() {
        return fileAnt;
    }

    public void setFileAnt(File fileAnt) {
        this.fileAnt = fileAnt;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }
    private long length;
    private byte[] data;
    private String nombre;
    private String extension;

    public byte[] getData() {
            return data;
    }
    public void setData(byte[] data) {
            this.data = data;
    }

    public String getName() {
            return Name;
    }

    public void setName(String name) {
            Name = name;
            int extDot = name.lastIndexOf('.');
            if(extDot > 0){
                    String extension = name.substring(extDot +1);
                    if("bmp".equals(extension)){
                            mime="image/bmp";
                    } else if("jpg".equals(extension)){
                            mime="image/jpeg";
                    } else if("gif".equals(extension)){
                            mime="image/gif";
                    } else if("png".equals(extension)){
                            mime="image/png";
                    } else {
                            mime = "image/unknown";
                    }
            }
    }
    public long getLength() {
            return length;
    }
    public void setLength(long length) {
            this.length = length;
    }

    public String getMime(){
            return mime;
    }

}
